<!DOCTYPE html>

<html>
    <head>
        <title>Cadastrar Sala Aluno</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link href="css/bootstrap.css" rel="stylesheet">
        <link href="css/bootstrap-responsive.css" rel="stylesheet">
  	<link href="css/stilo.css" rel="stylesheet">
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
        <script src="js/html5shiv.js"></script>
        <![endif]-->

    </head>
    <body>
       <div class="container">
           <?php include "topo.html"; ?>
           <?php include "menu.php"; ?>
           
           <!------------------------------------------Inicio do Conteudo------------------------------------->
		<section>
			<div id="conteudo">
				<div class="row-fluid">
					<div class="span12">
						<div class="titulo">
                                                    <p><b>Cadastrar Série e Turma de : <?php echo $resultado->usu_nome; ?></b></p>
						</div>
						<div class="bordas">
                                                    <div>
                                                        <form class="form-horizontal  enviar" method="POST" action="" >
                                
                                                                <!-- Select Basic -->
                                                                <div class="control-group">
                                                                  <label class="control-label" for="serie">Série</label>
                                                                  <div class="controls">
                                                                      <select id="serie" name="serie" class="input-large" >
                                                                        
                                                                        <?php 
                                                                        if(!isset($_POST['serie'])){
                                                                        echo '<option value="">Selecione</option>';    
                                                                        foreach ($consulta as $valor) {
                                                                            echo '<option value="'.$valor->id.'">'.$valor->ser_nome.'</option>';
                                                                        }}
                                                                        if(isset($_POST['serie'])){
                                                                            echo'<option value="'.$se->id.'">'.$se->ser_nome.'</option>';
                                                                              foreach ($consulta as $valor) {
                                                                            echo '<option value="'.$valor->id.'">'.$valor->ser_nome.'</option>';
                                                                            }
                                                                            
                                                                              }
                                                                        
                                                                        ?> 
                                                                    </select>
                                                                  </div>
                                                                </div>
                                                                
                                                                <!-- Select Basic -->
                                                                <div class="control-group">
                                                                  <label class="control-label" for="ano">Ano Letivo</label>
                                                                  <div class="controls">
                                                                      <select id="ano" name="ano" class="input-large" onchange="submit()"> 
                                                                        <?php 
                                                                        if(!isset($_POST['ano'])){
                                                                        echo '<option value="">Selecione</option>';    
                                                                        foreach ($ano as $valor) {
                                                                            echo '<option value="'.$valor->id.'">'.$valor->al_ano.'</option>';
                                                                        } }
                                                                        if(isset($_POST['ano'])){
                                                                        echo '<option value="$buscaidano->id">'.$buscaidano->al_ano.'</option>';    
                                                                        foreach ($ano as $valor) {
                                                                            echo '<option value="'.$valor->id.'">'.$valor->al_ano.'</option>';
                                                                        } }
                                                                        ?> 
                                                                    </select>
                                                                  </div>
                                                                </div>     
                                                        </form>
                                                            
                                                        
                                                            <form class="form-horizontal cargo" method="POST" action="index.php?pg=InserirSalaAluno" >
                                                                <fieldset>
 
                                                                <!-- Select Basic -->
                                                                <div class="control-group">
                                                                  <label class="control-label" for="turma">Turma</label>
                                                                  <div class="controls">
                                                                    <select id="turma" name="turma" class="input-large">
                                                                        <?php 
                                                                        if(!isset($_POST['serie'])){
                                                                        echo '<option value="">Aguardando Série e Ano</option>';
                                                                        }
                                                                        
                                                                        if(isset($_POST['serie'])){
                                                                        echo '<option value="">Selecione a Turma</option>';
                                                                        foreach ($busca as $va) {
                                                                            echo '<option value="'.$va->id.'">'.$va->tur_nome.'</option>';
                                                                        
                                                                        }
                                                                        }
                                                                        ?>  
                                                                    </select>
                                                                  </div>
                                                                </div>
                                                                
                                                                <!-- Text input-->
                                                                <div class="control-group">
                                                                  <div class="controls">
                                                                      <input id="idano" name="idano" placeholder="" value="<?php echo $idano; ?>" class="input-large" type="hidden">   
                                                                  </div>
                                                                </div>
                                                                
                                                                <!-- Text input-->
                                                                <div class="control-group">
                                                                  <div class="controls">
                                                                      <input id="idaluno" name="idaluno" placeholder="" value="<?php echo $id; ?>" class="input-large" type="hidden">   
                                                                  </div>
                                                                </div>
                                                                
                                                                <!-- Text input-->
                                                                <div class="control-group">
                                                                  <div class="controls">
                                                                      <input id="idserie" name="idserie" placeholder="" value="<?php echo $se->id; ?>" class="input-large" type="hidden">   
                                                                  </div>
                                                                </div>

                                            

                                                                <!-- Button -->
                                                                <div class="control-group">
                                                                  <label class="control-label" for="cadastrarsalaaluno"></label>
                                                                  <div class="controls">
                                                                    <button id="cadastrarsalaaluno" name="cadastrarsalaaluno" class="btn btn-primary">Salvar</button>
                                                                  </div>
                                                                </div>

                                                                </fieldset>
                                                              </form>
							</div>
						</div>
					</div>	
				</div>
			</div> <!-- Fim da linha conteudo -->
		</section><!-- ----------------------------------------fim do Conteudo----------------------------------- -->

           
           <?php include "rodape.html"; ?>
           
           
       </div><!-- fim da div container -->    
        
        
    <!-- Arquivos Javascripts ================================================== -->
    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.validate.js"></script>
    </body>
</html>
